﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VegetableStore.Domains;
using VegetableStore.Providers;

namespace VegetableStore.Util
{
    public class AuthUtil
    {
        public static bool IsAuthorized(string token)
        {
            Users user = SessionProvider.Instance.GetSession().CreateQuery("from Users where token = :token")
                .SetString("token", token)
                .UniqueResult<Users>();
            if (user == null) return false;
            else return true;
        }
    }
}